<?php
$webapi  = app('Dingo\Api\Routing\Router');             // API 路由接管
$option  = [
    'namespace'=>'App\Http\Controllers\Webapi',
    'prefix'=>'api/web',
    'middleware'=>['cors']
];

$webapi->version('v1',$option,function($webapi){
    $webapi->post('member/login','MemberController@login');     //学习官系统登录
    $webapi->post('member/autoLogin','MemberController@auto_login');     //学习官系统登录
});


array_push($option['middleware'],'checkToken');
$webapi->version('v1',$option,function($webapi){
    $api = $webapi;
    $api->post('prisident/prisidentIndex','PrisidentController@prisident_index');
    $api->post('chapter/chapterInfo','ChapterController@chapter_info');
    $api->post('chapter/prisidents','ChapterController@prisidents');
    $api->post('chapter/officers','ChapterController@officers');
    $api->post('chapter/members','ChapterController@members');
    $api->post('chapter/companys','ChapterController@companys');
    $api->post('chapter/companyPackages','ChapterController@company_packages');


    $api->post('chapter/addOrder','ChapterOrderController@add_order');
    $api->post('chapter/getOrders','ChapterOrderController@get_orders');
    $api->post('chapter/orderInfo','ChapterOrderController@get_order_info');
    $api->post('chapter/handOrder','ChapterOrderController@hand_order');
    $api->post('chapter/upgradeCompany','ChapterOrderController@upgrade_company');      //升级订单



    $api->post('member/freshMemberInfo',    'MemberController@fresh_member_info');
    $api->post('member/freshToken',         'MemberController@fresh_token');
    $api->post('member/memberInfo',         'MemberController@member_info');
    $api->post('member/getRoles',           'MemberController@get_roles');
    $api->post('prisident/prisidentInfo',   'PrisidentController@prisident_info');
    $api->post('officer/officerInfo',       'OfficerController@officer_info');
    $api->post('company/companyInfo',       'CompanyController@company_info');
    $api->post('company/companyDetail',     'CompanyController@company_detail');


    //体现
    $api->post('money/{action}',    'MoneyController@action');



});



